package com.globallogic.jira.gadget.composite;

/**
 * 
 * @author yegor.chumakov
 * 
 *         Action's that can be performed with issues.
 * 
 *         <tt>None</tt> is special case, when parameter is null or invalid.
 * 
 */

public enum IssueAction {
    ADD, ASSIGN, RESOLVE, NONE;

    public static IssueAction getValue(final String raw) {
	if (raw == null || raw.isEmpty())
	    return NONE;
	else if ("add".equalsIgnoreCase(raw))
	    return ADD;
	else if ("assign".equalsIgnoreCase(raw))
	    return ASSIGN;
	else if ("resolve".equalsIgnoreCase(raw))
	    return RESOLVE;
	else
	    return NONE;
    }
}
